/*
*   升级管理模块相关请求
*/
import axios from 'axios';
import {get,post} from '../axios/tools';
import * as URL_CONFIG from '../axios/config';

/**************************************版本信息管理 Start*****************************************/

//版本信息管理-版本信息表
export const getVersionInfo = (params) => get({url: URL_CONFIG.VERSIONINFO_GET_PAGE + '?' + params }); //分页查询
export const getVersionInfoById = (params) => get({url: URL_CONFIG.VERSIONINFO_GET_BYID + '?' + params }); //通过id查询
export const versionInfoSave = (params) => post({url: URL_CONFIG.VERSIONINFO_SAVE + '?' + params }); //新增
export const versionInfoDelete = (params) => post({url: URL_CONFIG.VERSIONINFO_DELETE + '?' + params }); //删除
export const versionInfoUpdate = (params) => post({url: URL_CONFIG.VERSIONINFO_UPDATE + '?' + params }); //修改
export const versionInfoUpdateTag = (params) => post({url: URL_CONFIG.VERSIONINFO_UPDATE_TAG + '?' + params }); //启用禁用操作
export const getVersionInfoGetList = (params) => get({url: URL_CONFIG.VERSIONINFO_GET_LIST + '?' + params }); //选用模板列表
export const versionInfoGetExport = (params) => axios.get(URL_CONFIG.VERSIONINFO_GET_EXPORT + '?' + params, {ContentType: 'application/octet-stream'}); //导出选定版本信息
export const versionInfoGetIsUsedOfVersion = (params) => get({url: URL_CONFIG.VERSIONINFO_GET_ISUSEDOFVERSION + '?' + params }); //导出选定版本信息
//版本信息管理-设置页面
export const getSettingsItem = (params) => get({url: URL_CONFIG.SETTINGSITEM_GET_PAGE + '?' + params }); //分页查询
export const getSettingsItemById = (params) => get({url: URL_CONFIG.SETTINGSITEM_GET_BYID + '?' + params }); //通过id查询
export const settingsItemSave = (params) => post({url: URL_CONFIG.SETTINGSITEM_SAVE + '?' + params }); //新增
export const settingsItemDelete = (params) => post({url: URL_CONFIG.SETTINGSITEM_DELETE + '?' + params }); //删除
export const settingsItemUpdate = (params) => post({url: URL_CONFIG.SETTINGSITEM_UPDATE + '?' + params }); //修改
export const settingsItemValidator = (params) => get({url: URL_CONFIG.SETTINGSITEM_VALIDATOR + '?' + params }); //校验设置信息
//版本信息管理-客户端信息
export const getClientInfo = (params) => get({url: URL_CONFIG.CLIENTINFO_GET_PAGE + '?' + params }); //分页查询
export const getClientInfoById = (params) => get({url: URL_CONFIG.CLIENTINFO_GET_BYID + '?' + params }); //通过id查询
export const clientInfoSave = (params) => post({url: URL_CONFIG.CLIENTINFO_SAVE + '?' + params }); //新增
export const clientInfoDelete = (params) => post({url: URL_CONFIG.CLIENTINFO_DELETE + '?' + params }); //删除
export const clientInfoUpdate = (params) => post({url: URL_CONFIG.CLIENTINFO_UPDATE + '?' + params }); //修改
export const clientInfoValidator = (params) => get({url: URL_CONFIG.CLIENTINFO_VALIDATOR + '?' + params }); //校验客户端信息
//版本信息管理-泡泡信息
export const getPopupInfo = (params) => get({url: URL_CONFIG.POPUPINFO_GET_PAGE + '?' + params }); //分页查询
export const getPopupInfoById = (params) => get({url: URL_CONFIG.POPUPINFO_GET_BYID + '?' + params }); //通过id查询
export const popupInfoSave = (params) => post({url: URL_CONFIG.POPUPINFO_SAVE + '?' + params }); //新增
export const popupInfoDelete = (params) => post({url: URL_CONFIG.POPUPINFO_DELETE + '?' + params }); //删除
export const popupInfoUpdate = (params) => post({url: URL_CONFIG.POPUPINFO_UPDATE + '?' + params }); //修改
export const popupInfoValidator = (params) => get({url: URL_CONFIG.POPUPINFO_VALIDATOR + '?' + params }); //校验泡泡信息
//版本信息管理-泡泡条件信息
export const getConditionPopup = (params) => get({url: URL_CONFIG.CONDITIONPOPUP_GET_PAGE + '?' + params }); //分页查询
export const getConditionPopupById = (params) => get({url: URL_CONFIG.CONDITIONPOPUP_GET_BYID + '?' + params }); //通过id查询
export const conditionPopupSave = (params) => post({url: URL_CONFIG.CONDITIONPOPUP_SAVE + '?' + params }); //新增
export const conditionPopupDelete = (params) => post({url: URL_CONFIG.CONDITIONPOPUP_DELETE + '?' + params }); //删除
export const conditionPopupUpdate = (params) => post({url: URL_CONFIG.CONDITIONPOPUP_UPDATE + '?' + params }); //修改
//版本信息管理-升级包信息
export const getPatchInfo = (params) => get({url: URL_CONFIG.PATCHINFO_GET_PAGE + '?' + params }); //分页查询
export const getPatchInfoById = (params) => get({url: URL_CONFIG.PATCHINFO_GET_BYID + '?' + params }); //通过id查询
export const patchInfoSave = (params) => post({url: URL_CONFIG.PATCHINFO_SAVE + '?' + params }); //新增
export const patchInfoDelete = (params) => post({url: URL_CONFIG.PATCHINFO_DELETE + '?' + params }); //删除
export const patchInfoUpdate = (params) => post({url: URL_CONFIG.PATCHINFO_UPDATE + '?' + params }); //修改
//版本信息管理-升级包条件信息
export const getConditionPatch = (params) => get({url: URL_CONFIG.CONDITIONPATCH_GET_PAGE + '?' + params }); //分页查询
export const getConditionPatchById = (params) => get({url: URL_CONFIG.CONDITIONPATCH_GET_BYID + '?' + params }); //通过id查询
export const conditionPatchSave = (params) => post({url: URL_CONFIG.CONDITIONPATCH_SAVE + '?' + params }); //新增
export const conditionPatchDelete = (params) => post({url: URL_CONFIG.CONDITIONPATCH_DELETE + '?' + params }); //删除
export const conditionPatchUpdate = (params) => post({url: URL_CONFIG.CONDITIONPATCH_UPDATE + '?' + params }); //修改
//版本信息管理-动作信息
export const getActions = (params) => get({url: URL_CONFIG.ACTIONS_GET_PAGE + '?' + params }); //分页查询
export const getActionsById = (params) => get({url: URL_CONFIG.ACTIONS_GET_BYID + '?' + params }); //通过id查询
export const actionsSave = (params) => post({url: URL_CONFIG.ACTIONS_SAVE + '?' + params }); //新增
export const actionsDelete = (params) => post({url: URL_CONFIG.ACTIONS_DELETE + '?' + params }); //删除
export const actionsUpdate = (params) => post({url: URL_CONFIG.ACTIONS_UPDATE + '?' + params }); //修改
export const actionsValidator = (params) => get({url: URL_CONFIG.ACTIONS_VALIDATOR + '?' + params }); //校验动作信息
export const actionsGetIndexDesc = (params) => get({url: URL_CONFIG.ACTIONS_GETINDEXDESC + '?' + params }); //根据vid获取动作信息的index值

/**************************************版本信息管理 End*******************************************/


/**************************************公用信息管理 Start*****************************************/

/* 限制IP */
//允许IP
export const allowIPsPage = (params) => get({url:`${URL_CONFIG.ALLOW_IPS_GET_PAGE}?${params}`});//分页查询
export const allowIPGetById = (id) => get({url:`${URL_CONFIG.ALLOW_IP_GET_BY_ID}?id=${id}`});//根据id查找
export const allowIPSaveOrEdit = (params) => post({url:URL_CONFIG.ALLOW_IP_SAVE_OR_EDIT,data:params});//新增或者编辑
export const allowIPDeleteById = (id) => post({url:`${URL_CONFIG.ALLOW_IP_DELETE_BY_ID}?id=${id}`});//根据id删除
export const allowIPExport = () => axios.get(URL_CONFIG.ALLOW_IP_EXPORT, {responseType: 'blob'});//导出excel
//拒绝IP
export const denyIPsPage = (params) => get({url:`${URL_CONFIG.DENY_IPS_GET_PAGE}?${params}`});//分页查询
export const denyIPGetById = (id) => get({url:`${URL_CONFIG.DENY_IP_GET_BY_ID}?id=${id}`});//根据id查找
export const denyIPSaveOrEdit = (params) => post({url:URL_CONFIG.DENY_IP_SAVE_OR_EDIT,data:params});//新增或者编辑
export const denyIPDeleteById = (id) => post({url:`${URL_CONFIG.DENY_IP_DELETE_BY_ID}?id=${id}`});//根据id删除
export const denyIPExport = () =>axios.get(URL_CONFIG.DENY_IP_EXPORT, {responseType: 'blob'});//导出excel

/* 限制版本表 */
//允许版本
export const allowVersionsPage = (params) => get({url:`${URL_CONFIG.ALLOW_VERSIONS_GET_PAGE}?${params}`});//分页查询
export const allowVersionGetById = (id) => get({url:`${URL_CONFIG.ALLOW_VERSION_GET_BY_ID}?id=${id}`});//根据id查找
export const allowVersionSaveOrEdit = (params) => post({url:URL_CONFIG.ALLOW_VERSION_SAVE_OR_EDIT,data:params});//新增或者编辑
export const allowVersionDeleteById = (id) => post({url:`${URL_CONFIG.ALLOW_VERSION_DELETE_BY_ID}?id=${id}`});//根据id删除
export const allowVersionValidator= (params) => get({url:`${URL_CONFIG.ALLOW_VERSON_VALIDATOR}?${params}`});//校验
export const allowVersionExport = () => axios.get(URL_CONFIG.ALLOW_VERSON_EXPORT, {responseType: 'blob'});//导出excel
//拒绝版本
export const denyVersionsPage = (params) => get({url:`${URL_CONFIG.DENY_VERSIONS_GET_PAGE}?${params}`});//分页查询
export const denyVersionGetById = (id) => get({url:`${URL_CONFIG.DENY_VERSION_GET_BY_ID}?id=${id}`});//根据id查找
export const denyVersionSaveOrEdit = (params) => post({url:URL_CONFIG.DENY_VERSION_SAVE_OR_EDIT,data:params});//新增或者编辑
export const denyVersionDeleteById = (id) => post({url:`${URL_CONFIG.DENY_VERSION_DELETE_BY_ID}?id=${id}`});//根据id删除
export const denyVersionValidator= (params) => get({url:`${URL_CONFIG.DENY_VERSION_VALIDATOR}?${params}`});//校验
export const denyVersionExport = () => axios.get(URL_CONFIG.DENY_VERSION_EXPORT, {responseType: 'blob'});//导出excel

/* 限制MAC表 */
//允许MAC
export const allowMACsPage = (params) => get({url:`${URL_CONFIG.ALLOW_MACS_GET_PAGE}?${params}`});//分页查询
export const allowMACGetById = (id) => get({url:`${URL_CONFIG.ALLOW_MAC_GET_BY_ID}?id=${id}`});//根据id查找
export const allowMACSave = (params) => post({url:URL_CONFIG.ALLOW_MAC_SAVE,data:params});//新增
export const allowMACUpdate = (params) => post({url:URL_CONFIG.ALLOW_MAC_UPDATE,data:params});//编辑
export const allowMACDeleteById = (id) => post({url:`${URL_CONFIG.ALLOW_MAC_DELETE_BY_ID}?id=${id}`});//根据id删除
export const allowMACValidator= (params) => get({url:`${URL_CONFIG.ALLOW_MAC_VALIDATOR}?${params}`});//校验
export const allowMACExport = () => axios.get(URL_CONFIG.ALLOW_MAC_EXPORT, {responseType: 'blob'});//导出excel
//拒绝MAC
export const denyMACsPage = (params) => get({url:`${URL_CONFIG.DENY_MACS_GET_PAGE}?${params}`});//分页查询
export const denyMACGetById = (id) => get({url:`${URL_CONFIG.DENY_MAC_GET_BY_ID}?id=${id}`});//根据id查找
export const denyMACSave = (params) => post({url:URL_CONFIG.DENY_MAC_SAVE,data:params});//新增
export const denyMACUpdate = (params) => post({url:URL_CONFIG.DENY_MAC_UPDATE,data:params});//编辑
export const denyMACDeleteById = (id) => post({url:`${URL_CONFIG.DENY_MAC_DELETE_BY_ID}?id=${id}`});//根据id删除
export const denyMACValidator= (params) => get({url:`${URL_CONFIG.DENY_MAC_VALIDATOR}?${params}`});//校验
export const denyMACExport = () => axios.get(URL_CONFIG.DENY_MAC_EXPORT, {responseType: 'blob'});//导出excel

/* 收集信息表 */
//信息收集
export const collectInfosPage = (params) => get({url:`${URL_CONFIG.COLLECT_INFOS_GET_PAGE}?${params}`});//分页查询
export const collectInfosGetById = (id) => get({url:`${URL_CONFIG.COLLECT_INFOS_GET_BY_ID}?id=${id}`});//根据id查找
export const collectInfosSave = (params) => post({url:URL_CONFIG.COLLECT_INFOS_SAVE,data:params});//新增
export const collectInfosUpdate = (params) => post({url:URL_CONFIG.COLLECT_INFOS_UPDATE,data:params});//编辑
export const collectInfosDeleteById = (id) => post({url:`${URL_CONFIG.COLLECT_INFOS_DELETE_BY_ID}?id=${id}`});//根据id删除
export const collectInfosValidator= (params) => get({url:`${URL_CONFIG.COLLECT_INFOS_VALIDATOR}?${params}`});//校验
//收集信息详情
export const collectInfoPage = (params) => get({url:`${URL_CONFIG.COLLECT_INFO_GET_PAGE}?${params}`});//分页查询
export const collectInfoGetById = (id) => get({url:`${URL_CONFIG.COLLECT_INFO_GET_BY_ID}?id=${id}`});//根据id查找
export const collectInfoSave = (params) => post({url:URL_CONFIG.COLLECT_INFO_SAVE,data:params});//新增
export const collectInfoUpdate = (params) => post({url:URL_CONFIG.COLLECT_INFO_UPDATE,data:params});//编辑
export const collectInfoDeleteById = (params) => post({url:URL_CONFIG.COLLECT_INFO_DELETE_BY_ID,data:params});//根据id删除
export const collectInfoValidator= (params) => get({url:`${URL_CONFIG.COLLECT_INFO_VALIDATOR}?${params}`});//校验

/* 语言表 */
export const languagesPage = (params) => get({url:`${URL_CONFIG.LANGUAGES_GET_PAGE}?${params}`});//分页查询
export const languageGetById = (id) => get({url:`${URL_CONFIG.LANGUAGE_GET_BY_ID}?id=${id}`});//根据id查找
export const languageSaveOrEdit = (params) => post({url:URL_CONFIG.LANGUAGE_SAVE_OR_EDIT,data:params});//新增或者编辑
export const languageDeleteById = (params) => post({url:URL_CONFIG.LANGUAGE_DELETE_BY_ID,data:params});//根据id删除
export const languageValidator= (params) => get({url:`${URL_CONFIG.LANGUAGE_VALIDATOR}?${params}`});//校验

/* 公用设置表 */
export const settingCommonsPage = (params) => get({url:`${URL_CONFIG.SETTING_COMMONS_GET_PAGE}?${params}`});//分页查询
export const settingCommonGetById = (id) => get({url:`${URL_CONFIG.SETTING_COMMON_GET_BY_ID}?id=${id}`});//根据id查找
export const settingCommonSave = (params) => post({url:URL_CONFIG.SETTING_COMMON_SAVE,data:params});//新增
export const settingCommonUpdate = (params) => post({url:URL_CONFIG.SETTING_COMMON_UPDATE,data:params});//编辑
export const settingCommonDeleteById = (params) => post({url:URL_CONFIG.SETTING_COMMON_DELETE_BY_ID,data:params});//根据id删除
export const settingCommonValidator= (params) => get({url:`${URL_CONFIG.SETTING_COMMON_VALIDATOR}?${params}`});//校验

/* 下载服务器列表 */
export const downloadsPage = (params) => get({url:`${URL_CONFIG.DOWNLOADS_GET_PAGE}?${params}`});//分页查询
export const downloadGetById = (id) => get({url:`${URL_CONFIG.DOWNLOAD_GET_BY_ID}?id=${id}`});//根据id查找
export const downloadSaveOrEdit = (params) => post({url:URL_CONFIG.DOWNLOAD_SAVE_OR_EDIT,data:params});//新增或者编辑
export const downloadDeleteById = (params) => post({url:URL_CONFIG.DOWNLOAD_DELETE_BY_ID,data:params});//根据id删除
export const downloadValidator= (params) => get({url:`${URL_CONFIG.DOWNLOAD_VALIDATOR}?${params}`});//校验
/*export const downloadImport= (params) => post({url:URL_CONFIG.DOWNLOAD_IMPORT,data:params});//导入*/
export const downloadExport= () => axios.get(URL_CONFIG.DOWNLOAD_EXPORT, {responseType: 'blob'});//导出
/**************************************公用信息管理 End*******************************************/


/**************************************系统信息管理 Start*****************************************/
/* 日志信息 */
export const systemLog = (params) => get({url:`${URL_CONFIG.SYSTEM_LOG}?${params}`});

// 准许/流量/状态报表查询
export const logStatusGetChart = (params) => get({url:URL_CONFIG.LOGSTATUS_GET_CHART + '?' + params });//准许/流量/状态报表查询
//当前状态
export const logStatusGetStatus = () => get({url:URL_CONFIG.LOGSTATUS_GET_STATUS}); //获取表格数据
export const logStatusGetValidator = (params) => get({url:URL_CONFIG.LOGSTATUS_GET_VALIDATOR+'?'+params}); //验证请求
export const logStatusSyncRedis = () => get({url:URL_CONFIG.LOGSTATUS_SYSNCREDIS}); //全量同步Redis

/**************************************系统信息管理 End*******************************************/
